#include "thread_hal.h"
#include "websocket_client.h"


int web_proxy_write_data(char *p_buf, int len)
{

    websocket_client_write_data(p_buf, len);
}

void web_proxy_task(void * param)
{
    WebSock_Status websocket_status;

    while(1){

        thread_time_sleep(1000);

        websocket_status = websocket_client_get_status();
        switch(websocket_status){
            case Socket_Connected:
            case Socket_Created:
                
                websocket_client_active_rw_action();
                break;
            case Socket_Close:
            case Socket_Error:
                websocket_client_destory();
                break;
            case Socket_Init:                
                websocket_client_create( (char*)param,FISH_PROTOCOL_PORT);
                break;
        }
        
    }

}